<?php 
class FckHelper extends Helper
{
	function load($id, $toolbar = 'Default') {
		$did = "";
		foreach (explode('.', $id) as $v) {
	 		$did .= ucfirst($v);
		}
		
		$host = Configure::read('base_url');

		return <<<FCK_CODE
<script type="text/javascript">
fckLoader_$did = function () {
	var bFCKeditor_$did = new FCKeditor('$did');
	bFCKeditor_$did.BasePath = '$host/js/';
	bFCKeditor_$did.ToolbarSet = '$toolbar';
	bFCKeditor_$did.Width = '740px';
	bFCKeditor_$did.Height = '395px';
	bFCKeditor_$did.ReplaceTextarea();
}
fckLoader_$did();
</script>
FCK_CODE;
	}
}
?>